package pri.damai.xiaowu.auth.enums;


import pri.damai.xiaowu.common.core.enums.base.StringEnumerator;

import java.io.Serializable;

/**
 *
 * @Desc
 * @Author DaMai
 * @Date 2021/10/13 17:47
 * 但行好事，莫问前程。
 */
public enum ResultEnum implements StringEnumerator, Serializable {

    /**  */
    INVALID_TOKEN("100008", "无效的TOKEN。"),
    LOGIN_FAIL("020003", "登录失败。"),
    LOGIN_PARAM_ERROR("020004", "登录参数错误。"),
    LOGIN_CHECK_ERROR("020005", "登录校验失败。"),
    NO_LOGIN_TYPE_LOGIC("020006", "不支持的登录方式。"),
    USER_NOT_FOUND("020007", "账户不存在。"),
    NOT_TOKEN("020008", "未携带 TOKEN。"),
    INVALID_CODE("020010", "验证码失效。"),
    CODE_ERROR("020011", "验证码错误"),
    USB_KEY_VALID_FAIL("020012", "USB KEY 验证失败。"),
    CODE_SEND_FREQUENT("020013", "验证码发送频繁。%s"),
    CODE_RULE_ERROR("020014", "验证码 %s 分钟内超过 %s 次。请稍后重试。"),
    LOGOUT_FAIL("020016", "注销失败。"),
    OAUTH2_EXCEPTION("020017","政务用户登陆失败,请重新登录"),
    OAUTH2_COPYMESSAGE_EXCEPTION("020018","政务用户,企业用户未获取到社会信用代码,请重新登录"),
    OAUTH2_NATURE_EXCEPTION("020019","政务用户,自然人未获取到手机号,请重新登录"),
    KEY_USER_MESSAGE_ERROR("020020","未获取到用户信息"),
    REQ_ERROR("020021", "网络请求异常。"),
    UNAUTHORIZED("020022","未认证");

    private final String code;
    private final String msg;

    ResultEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String code() {
        return this.code;
    }

    @Override
    public String desc() {
        return this.msg;
    }
}
